var app = angular.module('app');

app.factory('phoneUtilsService', [function () {
    var phoneUtilsService = {};

    /**
     * get properties from a object
     */
    phoneUtilsService.validateMobileNumber = function (number) {
        if (!number) {
            return false;
        }

        var reg = /^1[3|4|5|7|8][0-9]{9}$/; //验证规则
        // let reg = /^1[3|4|5|8][0-9]\d{4,8}$/; //验证规则
        if(!(reg.test(number))){
            return false;
        }

        return true;
    };
    return phoneUtilsService;
}]);